<?php

namespace App\HttpController\Index;
use EasySwoole\Http\AbstractInterface\Controller;
use EasySwoole\EasySwoole\ServerManager;

class Index extends Base
{

    function index(){
     	$redis = new \Redis();
        $redis = $redis->connect('127.0.0.1', 6379);
      	var_dump('redis connect'.$redis);
        $this->response()->write('easyswoole');
    }

    function test()
    {
        $conf = new \EasySwoole\Mysqli\Config(\EasySwoole\EasySwoole\Config::getInstance()->getConf('MYSQL'));
        $db = new \EasySwoole\Mysqli\Mysqli($conf);
        $data = $db->get('wp_users');//获取一个表的数据
        var_dump($data);
        $this->response()->write('easyswoole');
    }

	//聊天室
    function room(){
         $assign = [
             'name'=>'hello room',
         ];
         $this->assign($assign);
     	 $this->fetch('Index/room');      # 对应模板: Views/Index/room.html
    }

   


}